from signals import BaseRedRVariable

class SQLiteDatabase(BaseRedRVariable): 
    convertToList = []
    convertFromList = []
    def __init__(self, widget, data, checkVal = False, **kwargs):
        BaseRedRVariable.__init__(self,widget = widget, data = data)
        
    def convertToClass(self, varClass):
        return self
    def getDatabase(self):
        """Returns a formatted database location with the local| conventions in place."""
        if 'local|' in self.getData():  # convert the database if the local name is present.
            database = os.path.join(redREnviron.directoryNames['tempDir'], self.database.split('|')[1])
        else:
            database = self.getData()
        return database